package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysTreeDictTypeMapper;
import com.ruoyi.system.domain.SysTreeDictType;
import com.ruoyi.system.service.ISysTreeDictTypeService;

/**
 * 树形字典类型Service业务层处理
 * 
 * @author genghz
 * @date 2021-11-17
 */
@Service
public class SysTreeDictTypeServiceImpl implements ISysTreeDictTypeService 
{
    @Autowired
    private SysTreeDictTypeMapper sysTreeDictTypeMapper;

    /**
     * 查询树形字典类型
     * 
     * @param dictId 树形字典类型主键
     * @return 树形字典类型
     */
    @Override
    public SysTreeDictType selectSysTreeDictTypeByDictId(Long dictId)
    {
        return sysTreeDictTypeMapper.selectSysTreeDictTypeByDictId(dictId);
    }

    /**
     * 查询树形字典类型列表
     * 
     * @param sysTreeDictType 树形字典类型
     * @return 树形字典类型
     */
    @Override
    public List<SysTreeDictType> selectSysTreeDictTypeList(SysTreeDictType sysTreeDictType)
    {
        return sysTreeDictTypeMapper.selectSysTreeDictTypeList(sysTreeDictType);
    }

    /**
     * 新增树形字典类型
     * 
     * @param sysTreeDictType 树形字典类型
     * @return 结果
     */
    @Override
    public int insertSysTreeDictType(SysTreeDictType sysTreeDictType)
    {
        sysTreeDictType.setCreateTime(DateUtils.getNowDate());
        return sysTreeDictTypeMapper.insertSysTreeDictType(sysTreeDictType);
    }

    /**
     * 修改树形字典类型
     * 
     * @param sysTreeDictType 树形字典类型
     * @return 结果
     */
    @Override
    public int updateSysTreeDictType(SysTreeDictType sysTreeDictType)
    {
        sysTreeDictType.setUpdateTime(DateUtils.getNowDate());
        return sysTreeDictTypeMapper.updateSysTreeDictType(sysTreeDictType);
    }

    /**
     * 批量删除树形字典类型
     * 
     * @param dictIds 需要删除的树形字典类型主键
     * @return 结果
     */
    @Override
    public int deleteSysTreeDictTypeByDictIds(Long[] dictIds)
    {
        return sysTreeDictTypeMapper.deleteSysTreeDictTypeByDictIds(dictIds);
    }

    /**
     * 删除树形字典类型信息
     * 
     * @param dictId 树形字典类型主键
     * @return 结果
     */
    @Override
    public int deleteSysTreeDictTypeByDictId(Long dictId)
    {
        return sysTreeDictTypeMapper.deleteSysTreeDictTypeByDictId(dictId);
    }
}
